package com.slz.crm.common.enumeration;

import lombok.Getter;

/**
 * CRM系统权限操作枚举类
 * 按模块分类定义所有核心操作
 */
public class PermissionOperates {


    public interface Operation {
        Long getId();
        String getDescription();
    }

    /**
     * 客户管理模块操作枚举
     * id:100
     */
    @Getter
    public enum CustomerOperate implements Operation {

        //联系人操作
        EXCEL_ADD(101L,"通过EXCEL添加数据"),
        UPDATE_CONTACT(102L,"批量更新数据"),
        ADD_CONTACT(103L,"新增联系人"),
        DELETE_CONTACT(104L,"删除联系人"),
        RECOVER_CONTACT(105L,"批量恢复联系人"),
        GET_CONTACT_BY_COMPANY_ID(106L,"根据公司ID查询联系人列表"),
        EXPORT_CONTACT(107L,"导出联系人列表"),
        GROUP_QUERY_CONTACT(108L,"分组查询联系人"),
        PAGINATION_QUERY_CONTACT(109L,"分页查询联系人"),
        CUSTOM_QUERY_CONTACT(110L,"组合查询联系人"),


        //客户公司操作
        ADD_COMPANY(111L,"新增客户公司"),
        ADD_CUSTOMER_COMPANY(112L,"新增客户公司列表"),
        UPDATE_CUSTOMER_COMPANY(113L,"更新客户公司列表"),
        DELETE_CUSTOMER_COMPANY(114L,"删除客户公司列表"),
        RECOVER_CUSTOMER_COMPANY(115L,"恢复客户公司列表"),
        GET_COMPANY_DETAIL_BY_CONTACT(116L,"根据联系人信息获取其所属公司信息"),
        EXPORT_CUSTOMER_COMPANY(117L,"导出客户公司数据"),
        MERGE_COMPANY(118L,"合并客户公司"),
        GET_ALL_COMPANY(119L,"获取所有客户公司"),
        GET_CUSTOMER_COMPANY_DETAIL(120L,"获取客户公司详情"),
        FUZZY_QUERY_CUSTOMER_COMPANY(121L,"模糊查询客户公司"),
        CUSTOM_QUERY_CUSTOMER_COMPANY(122L,"自定义查询客户公司"),
        GROUP_QUERY_CUSTOMER_COMPANY(123L,"分组查询客户公司");

        private final Long id;
        private final String description;

        CustomerOperate(Long id,String description) {
            this.description = description;
            this.id = id;
        }

    }

    /**
     * 销售管理模块操作枚举
     * id:200
     */
    @Getter
    public enum SalesOperate implements Operation{


        // 销售机会管理
        CREATE_SALE_OPPORTUNITY(201L,"创建销售机会"),
        UPDATE_SALE_OPPORTUNITY(202L,"修改销售机会"),
        DELETE_SALE_OPPORTUNITY(203L,"删除销售机会"),
        VIEW_SALE_OPPORTUNITY(204L,"查看所有销售机会"),
        CUSTOM_QUERY_SALE_OPPORTUNITY(205L,"自定义查询销售机会"),



        // 合同与订单管理

        APPEND_ORDER(206L,"追加订单"),
        BATCH_DELETE_ORDER(207L,"批量删除订单"),
        CUSTOM_QUERY_ORDER(208L,"自定义查询订单"),
        VIEW_ORDER_DETAIL_BY_ID(209L,"根据ID查看订单详情"),
        UPDATE_ORDER(210L,"更新合同关联的订单"),

        CREATE_CONTRACT(211L,"创建合同"),
        VIEW_CONTRACT_DETAIL_BY_ID(212L,"根据ID查看合同详情"),
        CUSTOM_QUERY_CONTRACT(213L,"自定义查询合同列表"),
        UPDATE_CONTRACT(214L,"更新合同信息"),
        BATCH_DELETE_CONTRACT(215L,"批量删除合同"),
        VIEW_CONTRACT(227L,"查看所有合同"),



        // 项目阶段管理
        PROGRESS_SALE_OPPORTUNITY_STAGE(216L,"推进销售机会阶段"),
        APPROVE_STAGE_ADVANCE(217L,"审批推进阶段"),
        DELETE_STAGE_ADVANCE(218L,"删除推进请求"),
        CUSTOM_QUERY_SALE_OPPORTUNITY_STAGE(219L,"自定义查询销售机会阶段"),
        GET_APPROVAL_ATTACHMENT_BY_APPROVAL_ID(220L,"通过销售机会阶段审批ID获取附件"),



        //商业活动管理
        CREATE_BUSINESS_ACTIVITY(221L,"创建商业活动"),
        UPDATE_BUSINESS_ACTIVITY(222L,"更新商业活动"),
        DELETE_BUSINESS_ACTIVITY(223L,"删除商业活动"),
        GET_ALL_BUSINESS_ACTIVITY(224L,"获取所有活动"),
        BUSINESS_ACTIVITY_QUERY(225L,"自定义分页查询活动列表"),
        GET_BUSINESS_ACTIVITY_DETAIL(226L,"根据ID查看商业活动详情");



        private final String description;
        private final Long id;

        SalesOperate(Long id,String description) {
            this.description = description;
            this.id = id;
        }

    }

    /**
     * 财务管理模块操作枚举
     * id:300
     */
    @Getter
    public enum FinanceOperate implements Operation{
        ;
        /*// 回款管理
        RECORD_PAYMENT(301,"录入回款"),
        EDIT_PAYMENT("编辑回款信息"),
        DELETE_PAYMENT("删除回款记录"),
        RELATE_PAYMENT_ORDER("关联回款与订单"),
        VIEW_PAYMENT_STATUS("查看回款情况"),

        // 开票管理
        RECORD_INVOICE("记录开票信息"),
        EDIT_INVOICE("编辑开票信息"),
        DELETE_INVOICE("删除开票记录"),
        RELATE_INVOICE_PAYMENT("关联开票与收款"),
        VIEW_INVOICE_DETAIL("查看开票详情");*/

        private final String description;
        private final Long id;

        FinanceOperate(Long id,String description) {
            this.description = description;
            this.id = id;
        }

    }

    /**
     * 联络任务模块操作枚举
     * id:400
     */
    @Getter
    public enum TaskOperate implements Operation{

        // 任务管理
        CREATE_TASK(401L,"创建联络任务"),
        UPDATE_TASK(402L,"更新联络任务"),
        DELETE_TASK(403L,"删除联络任务"),
        VIEW_TASK(404L,"查看联络任务"),
        BATCH_DELETE_TASK(405L,"批量删除联络任务"),
        BATCH_UPDATE_TASK(406L,"批量更新联络任务"),
        QUERY_TASK_BY_ASSIGNEE(407L,"根据执行人查询任务"),
        QUERY_TASK_BY_COMPANY(408L,"根据公司查询任务"),
        QUERY_TASK_BY_CONTACT(409L,"根据联系人查询任务"),
        QUERY_TASK_BY_OPPORTUNITY(410L,"根据销售机会查询任务");

        private final String description;
        private final Long id;

        TaskOperate(Long id,String description) {
            this.description = description;
            this.id = id;
        }

    }

    /**
     * 统计报表模块操作枚举
     * id:500
     */
    @Getter
    public enum ReportOperate implements Operation{
        ;
        /*// 报表生成与查看
        VIEW_PRESET_REPORT(501,"查看系统预设报表"),
        GENERATE_CUSTOM_REPORT("生成自定义报表"),
        MERGE_REPORTS("合并多报表展示"),
        DATA_DRILL("数据钻取"),

        // 报表操作
        EXPORT_REPORT("导出报表"),
        SAVE_REPORT_TEMPLATE("保存报表模板"),
        EDIT_REPORT_TEMPLATE("编辑报表模板"),
        DELETE_REPORT_TEMPLATE("删除报表模板"),

        // 统计分析操作
        LIST_STATISTICS("列表统计"),
        GROUP_STATISTICS("分组统计");*/

        private final String description;
        private final Long id;

        ReportOperate(Long id,String description) {
            this.description = description;
            this.id = id;
        }

    }

    /**
     * 权限管理模块操作枚举
     * id:600
     */
    @Getter
    public enum SystemOperate implements Operation{
        // 用户权限管理
        CREATE_USER(601L,"创建用户"),
        VIEW_USER(602L,"查看所有用户"),
        UPDATE_PASSWORD(603L,"修改密码"),
        UPDATE_USER_INFO(604L,"修改用户信息");


        /*// 角色与功能权限管理
        CREATE_ROLE("创建角色"),
        EDIT_ROLE("编辑角色"),
        DELETE_ROLE("删除角色"),
        ASSIGN_FUNCTION_PERM("分配功能权限"),

        // 数据权限管理
        SET_DATA_SCOPE("设置数据可见范围"),
        ASSIGN_DATA("分配数据给用户/角色"),
        REVOKE_DATA_PERM("收回数据共享权限"),
        BATCH_TRANSFER_DATA("批量移交数据"),

        // 字段权限管理
        CONFIG_FIELD_VISIBLE("配置字段可见性"),
        CONFIG_FIELD_EDITABLE("配置字段可编辑性"),

        // 日志审计操作
        VIEW_PERM_LOG("查看权限变更日志"),
        VIEW_SENSITIVE_LOG("查看敏感操作日志");*/

        private final String description;
        private final Long id;

        SystemOperate(Long id,String description) {
            this.description = description;
            this.id = id;
        }

    }

    /**
     * 隐私信息查看权限
     * id:700
     */
    @Getter
    public enum ProjectOperate implements Operation{
        PHONE_VIEW(701L,"查看电话"),
        EMAIL_VIEW(702L,"查看邮箱"),
        TOTAL_VIEW(703L,"查看金额");

         private final String description;
         private final Long id;

         ProjectOperate(Long id,String description) {
             this.description = description;
             this.id = id;
         }
    }
}
